home *** CD-ROM | disk | FTP | other *** search
/ Sunday Savers: Singing Fun! / Sunday Savers: Singing Fun!.iso / mac / Xtras / Buddy API 1.6 / Buddy API Docs.swf / texts / 1564.txt < prev    next >
Encoding:
Text File  |  2004-08-31  |  3.9 KB  |  175 lines

  1. 144
  2. --- RECORDSEPARATOR ---
  3.  
  4. --- RECORDSEPARATOR ---
  5. FindFirstFile 
  6. --- RECORDSEPARATOR ---
  7. Platform:
  8. --- RECORDSEPARATOR ---
  9.  
  10. --- RECORDSEPARATOR ---
  11. Windows and Macintosh
  12. --- RECORDSEPARATOR ---
  13.  
  14. --- RECORDSEPARATOR ---
  15. Description:
  16. --- RECORDSEPARATOR ---
  17.  
  18. --- RECORDSEPARATOR ---
  19. baFindFirstFile searches for the first file matching a specification.
  20. --- RECORDSEPARATOR ---
  21.  
  22. --- RECORDSEPARATOR ---
  23. Usage:
  24. --- RECORDSEPARATOR ---
  25.  
  26. --- RECORDSEPARATOR ---
  27. Result = baFindFirstFile( StartDir, FileSpec )
  28. --- RECORDSEPARATOR ---
  29.  
  30. --- RECORDSEPARATOR ---
  31. A
  32. --- RECORDSEPARATOR ---
  33. rguments:
  34. --- RECORDSEPARATOR ---
  35.  
  36. --- RECORDSEPARATOR ---
  37. String, string. 
  38. --- RECORDSEPARATOR ---
  39. StartDir is the directory to start searching in. 
  40. --- RECORDSEPARATOR ---
  41. FileSpec is the pattern to search for.
  42. --- RECORDSEPARATOR ---
  43.  
  44. --- RECORDSEPARATOR ---
  45. Returns:
  46. --- RECORDSEPARATOR ---
  47.  
  48. --- RECORDSEPARATOR ---
  49. String 
  50. --- RECORDSEPARATOR ---
  51. Returns the full path to the first file found
  52. --- RECORDSEPARATOR ---
  53.  
  54. --- RECORDSEPARATOR ---
  55. Examples:
  56. --- RECORDSEPARATOR ---
  57.  
  58. --- RECORDSEPARATOR ---
  59. Director: 
  60. --- RECORDSEPARATOR ---
  61. set file = baFindFirstFile( "c:\", "netscape.exe" ) 
  62. --- RECORDSEPARATOR ---
  63. -- searches drive c for Netscape 
  64. --- RECORDSEPARATOR ---
  65. Authorware: 
  66. --- RECORDSEPARATOR ---
  67. file := baFindFirstFile( "c:\\windows", "*.ttf" ) 
  68. --- RECORDSEPARATOR ---
  69. -- searches for fonts
  70. --- RECORDSEPARATOR ---
  71.  
  72. --- RECORDSEPARATOR ---
  73. Notes:
  74. --- RECORDSEPARATOR ---
  75.  
  76. --- RECORDSEPARATOR ---
  77. All sub-directories of the starting directory will be included in the search. This 
  78. --- RECORDSEPARATOR ---
  79. function can be used with baFindNextFile to f
  80. --- RECORDSEPARATOR ---
  81. ind all files. On
  82. --- RECORDSEPARATOR ---
  83.  Windows
  84. --- RECORDSEPARATOR ---
  85. , when you 
  86. --- RECORDSEPARATOR ---
  87. are finished finding all the files you are interested in, you must call baFindClose to 
  88. --- RECORDSEPARATOR ---
  89. free memory allocated by baFindFirstFile. This is not necessary - but can be 
  90. --- RECORDSEPARATOR ---
  91. included - on
  92. --- RECORDSEPARATOR ---
  93.  Macintosh
  94. --- RECORDSEPARATOR ---
  95. --- RECORDSEPARATOR ---
  96. Here are examples of searching the C drive for all copies of "netscape.exe"
  97. --- RECORDSEPARATOR ---
  98.  
  99. --- RECORDSEPARATOR ---
  100. Director:
  101. --- RECORDSEPARATOR ---
  102.  
  103. --- RECORDSEPARATOR ---
  104. set fileList = [] 
  105. --- RECORDSEPARATOR ---
  106. -- a list to contain the found files 
  107. --- RECORDSEPARATOR ---
  108. set file = baFindFirstFile( "c:\", "netscape.exe" ) 
  109. --- RECORDSEPARATOR ---
  110. repeat while file <> "" 
  111. --- RECORDSEPARATOR ---
  112. -- loop through all found files and add to the list 
  113. --- RECORDSEPARATOR ---
  114. append( fileList, file ) 
  115. --- RECORDSEPARATOR ---
  116. set file = baFindNextFile() 
  117. --- RECORDSEPARATOR ---
  118. end repeat 
  119. --- RECORDSEPARATOR ---
  120. baFindClose()
  121. --- RECORDSEPARATOR ---
  122.  
  123. --- RECORDSEPARATOR ---
  124. Authorware Xtra:
  125. --- RECORDSEPARATOR ---
  126.  
  127. --- RECORDSEPARATOR ---
  128. fileList := [] 
  129. --- RECORDSEPARATOR ---
  130. -- a list to contain the found files 
  131. --- RECORDSEPARATOR ---
  132. file := baFindFirstFile( "c:\\", "netscape.exe" ) 
  133. --- RECORDSEPARATOR ---
  134. repeat while file <> "" 
  135. --- RECORDSEPARATOR ---
  136. AddLinear( fileList, file ) 
  137. --- RECORDSEPARATOR ---
  138. file := baFindNextFile() 
  139. --- RECORDSEPARATOR ---
  140. end repeat 
  141. --- RECORDSEPARATOR ---
  142. baFindClose()
  143. --- RECORDSEPARATOR ---
  144.  
  145. --- RECORDSEPARATOR ---
  146. Authorware UCD:
  147. --- RECORDSEPARATOR ---
  148.  
  149. --- RECORDSEPARATOR ---
  150. fileList := "" 
  151. --- RECORDSEPARATOR ---
  152. file := baFindFirstFile( "c:\\", "netscape.exe" ) 
  153. --- RECORDSEPARATOR ---
  154. repeat while file <> "" 
  155. --- RECORDSEPARATOR ---
  156. if fileList = "" then 
  157. --- RECORDSEPARATOR ---
  158. -- add names to fileList with returns between file names 
  159. --- RECORDSEPARATOR ---
  160. fileList := file 
  161. --- RECORDSEPARATOR ---
  162. else
  163. --- RECORDSEPARATOR ---
  164. fileList := fileList ^ Return ^ file 
  165. --- RECORDSEPARATOR ---
  166. end if 
  167. --- RECORDSEPARATOR ---
  168. -- get next file 
  169. --- RECORDSEPARATOR ---
  170. file := baFindNextFile() 
  171. --- RECORDSEPARATOR ---
  172. end repeat 
  173. --- RECORDSEPARATOR ---
  174. baFindClose()